package com.hpeu_01.day0126;


import java.time.LocalDate;

class Human {
    @MyAnnotation("男")
    private String sex;
    @MyAnnotation("2021-01-26")
    public LocalDate birth;

    public Human() {

    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public LocalDate getBirth() {
        return birth;
    }

    public void setBirth(LocalDate birth) {
        this.birth = birth;
    }
}
public class Person extends Human{
    private Integer id;
    private String name;
    public String grade;

    protected Person() {
        System.out.println("无参构造器");
    }

    public Person(Integer id, String name) {
        this.id = id;
        this.name = name;
        System.out.println("两个参数的构造器");
    }

    private Person(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public Person(String grade) {
        this.grade = grade;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", grade='" + grade + '\'' +
                '}';
    }
}
